﻿
using System;
using System.Collections.Generic;

namespace SignalRApplication.Contracts
{
    public class GameDetailDto
    {
        public Guid Id { get; set; }
        public string Description { get; set; }
        public int Status { get; set; }
        public string GameType { get; set; }
        public string PlayType { get; set; }
        public string GameCondition { get; set; }
        /// <summary>
        /// 创建者
        /// </summary>
        public string Creator { get; set; }
        /// <summary>
        /// 赢家
        /// </summary>
        public string Winner { get; set; }
        public string CurrentPlayer { get; set; }
        public List<PlayerInGameDto> Players { get; set; }
        public List<RecordDto> Records { get; set; }
        public List<string> ActivatePlayers { get
            {
                var res=new List<string>();
                foreach(var p in Players)
                {
                    if (p.PlayerStatus == "等待")
                        res.Add(p.PlayerName);
                }
                return res;
            } 
        }
        public string StatusName
        {
            get
            {
                switch (Status) 
                {
                    case 0:return "准备";
                    case 1:return "正在进行";
                    case 2: return "暂停";
                    case 3: return "结束";
                    case 4: return "结束(没有赢家)";
                }
                return "";
            }
        }
        public GameDetailDto()
        {
            Players = new List<PlayerInGameDto>();
            Records = new List<RecordDto>();
        }

    }
}
